package com.study.concurrent.C_ThreadSynchronizationHelperClass.e_SynchronizationOnCommonPoint;

/**
 * Created by 赵超 on 2017/3/25.
 * 计算查找到的总次数
 */
public class Grouper implements Runnable {
    private Results results;

    public Grouper(Results results) {
        this.results = results;
    }

    @Override
    public void run() {
        int finalResult = 0;
        System.out.printf("Grouper : 结果处理中...\n");
        int[] data = results.getData();
        for (int number : data) {
            finalResult += number;
        }
        System.out.printf("Grouper : 总次数为：%d\n", finalResult);
    }
}
